package com.ttedu.util;

import java.io.InputStream;
import java.util.Properties;


import org.apache.log4j.Logger;

public class PropertyUtil {
	private static final Logger logger = Logger.getLogger(PropertyUtil.class);
	private static Properties properties;
	private static Properties activitylogPro;
	static {
		// 加载属性文件
		try {
			InputStream inputStream = PropertyUtil.class.getClassLoader().getResourceAsStream("mongodb.properties");
			InputStream inputStream2 = PropertyUtil.class.getClassLoader().getResourceAsStream("activitylog.properties");
			try {
				properties = new Properties();
				properties.load(inputStream);
				activitylogPro=new Properties();
				activitylogPro.load(inputStream2);
			} catch (Exception e) {
				e.printStackTrace();
			} finally {
				inputStream.close();
			}
		} catch (Exception e) {
			logger.error(e.getMessage());
		}
	}

	public static String getProperty(String key) {
		return properties.getProperty(key);
	}
	public static String getactivitylogPro(String key) {
		return activitylogPro.getProperty(key);
	}
}
